/*
 * @Author: your name
 * @Date: 2021-04-12 00:21:10
 * @LastEditTime: 2021-12-01 14:06:48
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /fun_android/lib/ui/helper/dialog_helper.dart
 */
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:full_flutter/generated/l10n.dart';

class DialogHelper {
  static showLoginDialog(context) async {
    return await showCupertinoDialog(
      context: context,
      builder: (context) => CupertinoAlertDialog(
        title: Text(S.of(context)?.needLogin ?? ''),
        actions: <Widget>[
          CupertinoDialogAction(
            onPressed: () {
              Navigator.of(context).pop(false);
            },
            child: Text(
              S.of(context)!.actionCancel,
            ),
          ),
          CupertinoDialogAction(
            onPressed: () async {
              Navigator.of(context).pop(true);
            },
            child: Text(S.of(context)!.actionConfirm),
          ),
        ],
      ),
    );
  }
}
